<?php
/**
 */
class ExpressionsAttachementsTable extends Doctrine_Table
{
	public function addAttachements($filename,$exp_id)
	{
		$filename = ucfirst(addslashes(trim($filename)));		
		$exp_id = ucfirst(addslashes(trim($exp_id)));
		$ExpressionsAttachements = new ExpressionsAttachements();
		$ExpressionsAttachements ->expression_id = $exp_id;
		$ExpressionsAttachements ->attachments = $filename;
		$ExpressionsAttachements ->save();
		return $ExpressionsAttachements->id;
	}
	public function getAttachments($id)
	{
		$query=new Doctrine_Query();
		    $query->select('e.*')
		       ->from('ExpressionsAttachements e')
			   ->where("e.expression_id='".$id."'");
			      //echo $query;exit;
			   	$result = $query->execute(array(),Doctrine::HYDRATE_ARRAY);
				return $result;
	}
}